/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2024-03-20 22:15:21
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2024-03-21 09:27:06
 * @FilePath: \vue-h5\src\routers\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/**
 * @description: 路由
 * @author: nowThen
 */

import Vue from 'vue'
import Router from 'vue-router'

const Index = () => import(/* webpackChunkName: "apply" */ '@/views/index')
const Login = () => import(/* webpackChunkName: "login" */ '@/views/login')
const IndexEdit = () => import(/* webpackChunkName: "login" */ '@/views/index/edit')
const Error = () => import(/* webpackChunkName: "error" */ '@/views/error')

Vue.use(Router)

const routes = [
  {
    path: '/',
    name: 'index',
    component: Index,
    meta: {
      title: '首页'
    }
  },
  {
    path: '/indexedit',
    name: 'indexedit',
    component: IndexEdit,
    meta: {
      title: '编辑'
    }
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
    meta: {
      title: '登录', // 标题
      requireAuth: false, // 登录权限
      keepAlive: false
    }
  },
  {
    path: '/error',
    name: 'error',
    component: Error,
    meta: {
      title: '404页'
    }
  },
  {
    path: '*',
    redirect: 'error'
  }
]

const router = new Router({
  mode: 'history',
  // mode: 'hash',
  routes
})

export default router
